package com.ruoyi.wgjlcData.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.wgjlcData.domain.plat.DataWgjlcPdtchzhd;
import com.ruoyi.wgjlcData.mapper.DataWgjlcPdtchzhdMapper;
import com.ruoyi.wgjlcData.service.IDataWgjlcPdtchzhdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.Future;


/**
 * 无轨胶轮车-坡道停车制动测试项Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-27
 */
@Service
public class DataWgjlcPdtchzhdServiceImpl implements IDataWgjlcPdtchzhdService
{
    @Autowired
    private DataWgjlcPdtchzhdMapper dataWgjlcPdtchzhdMapper;

    /**
     * 查询无轨胶轮车-坡道停车制动测试项
     * 
     * @param pdtchzhdId 无轨胶轮车-坡道停车制动测试项主键
     * @return 无轨胶轮车-坡道停车制动测试项
     */
    @Override
    public DataWgjlcPdtchzhd selectDataWgjlcPdtchzhdByPdtchzhdId(Long pdtchzhdId)
    {
        return dataWgjlcPdtchzhdMapper.selectDataWgjlcPdtchzhdByPdtchzhdId(pdtchzhdId);
    }

    /**
     * 查询无轨胶轮车-坡道停车制动测试项列表
     * 
     * @param dataWgjlcPdtchzhd 无轨胶轮车-坡道停车制动测试项
     * @return 无轨胶轮车-坡道停车制动测试项
     */
    @Override
    public List<DataWgjlcPdtchzhd> selectDataWgjlcPdtchzhdList(DataWgjlcPdtchzhd dataWgjlcPdtchzhd)
    {
        return dataWgjlcPdtchzhdMapper.selectDataWgjlcPdtchzhdList(dataWgjlcPdtchzhd);
    }

    /**
     * 新增无轨胶轮车-坡道停车制动测试项
     * 
     * @param dataWgjlcPdtchzhd 无轨胶轮车-坡道停车制动测试项
     * @return 结果
     */
    @Override
    public int insertDataWgjlcPdtchzhd(DataWgjlcPdtchzhd dataWgjlcPdtchzhd)
    {
        dataWgjlcPdtchzhd.setCreateTime(DateUtils.getNowDate());
        return dataWgjlcPdtchzhdMapper.insertDataWgjlcPdtchzhd(dataWgjlcPdtchzhd);
    }

    /**
     * 修改无轨胶轮车-坡道停车制动测试项
     * 
     * @param dataWgjlcPdtchzhd 无轨胶轮车-坡道停车制动测试项
     * @return 结果
     */
    @Override
    public int updateDataWgjlcPdtchzhd(DataWgjlcPdtchzhd dataWgjlcPdtchzhd)
    {
        dataWgjlcPdtchzhd.setUpdateTime(DateUtils.getNowDate());
        return dataWgjlcPdtchzhdMapper.updateDataWgjlcPdtchzhd(dataWgjlcPdtchzhd);
    }

    /**
     * 查询无轨胶轮车-坡道停车制动测试项
     *
     * @param dataTaskId
     * @return 无轨胶轮车-坡道停车制动测试项
     */
    @Override
    public Future<List<DataWgjlcPdtchzhd>> selectDataWgjlcPdtchzhdByDataTaskId(Long dataTaskId) {
        return new AsyncResult<>(dataWgjlcPdtchzhdMapper.selectDataWgjlcPdtchzhdByDataTaskId(dataTaskId));
    }

    /**
     * 修改状态为2
     *
     * @param dataTaskId
     */
    @Override
    public int updateDataWgjlcPdtchzhdByDataTaskId(Long dataTaskId) {
        return dataWgjlcPdtchzhdMapper.updateDataWgjlcPdtchzhdByDataTaskId(dataTaskId);
    }

    /**
     * 批量新增无轨胶轮车-坡道停车制动测试项
     *
     * @param dataWgjlcPdtchzhd 无轨胶轮车-坡道停车制动测试项
     * @return 结果
     */
    @Override
    public int batchDataWgjlcPdtchzhd(List<DataWgjlcPdtchzhd> dataWgjlcPdtchzhd) {
        return dataWgjlcPdtchzhdMapper.batchDataWgjlcPdtchzhd(dataWgjlcPdtchzhd);
    }

    /**
     * 批量删除无轨胶轮车-坡道停车制动测试项
     * 
     * @param pdtchzhdIds 需要删除的无轨胶轮车-坡道停车制动测试项主键
     * @return 结果
     */
    @Override
    public int deleteDataWgjlcPdtchzhdByPdtchzhdIds(Long[] pdtchzhdIds)
    {
        return dataWgjlcPdtchzhdMapper.deleteDataWgjlcPdtchzhdByPdtchzhdIds(pdtchzhdIds);
    }

    /**
     * 删除无轨胶轮车-坡道停车制动测试项信息
     * 
     * @param pdtchzhdId 无轨胶轮车-坡道停车制动测试项主键
     * @return 结果
     */
    @Override
    public int deleteDataWgjlcPdtchzhdByPdtchzhdId(Long pdtchzhdId)
    {
        return dataWgjlcPdtchzhdMapper.deleteDataWgjlcPdtchzhdByPdtchzhdId(pdtchzhdId);
    }
}
